# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=apkid
_pkgname=APKiD
pkgver=2.1.5
pkgrel=4
epoch=2
pkgdesc='Android Application Identifier for Packers, Protectors, Obfuscators and Oddities.'
groups=('blackarch' 'blackarch-mobile')
arch=('any')
url='https://github.com/rednaga/APKiD'
license=('GPL-3.0')
depends=('python' 'python-yara-python-dex')
makedepends=('python-setuptools')
source=("https://github.com/rednaga/$_pkgname/archive/refs/tags/v$pkgver.tar.gz")
sha512sums=('11767921662fc6939a23694155c4d6e31d19b62d809e51aca6002669649bc97f2f0ee2eddfcd35804b41db39e9023269c4990d45181757d3e5e12224ac8dc413')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's|yara-python==3.11.0|yara-python|' setup.py
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.*
  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.GPL \
    LICENSE.COMMERCIAL
}

